#!/bin/bash

"Level Editor/Level.Editor" > "Level Editor/levels.h"



if ! grep -i 'Level Editor exited cleanly' "Level Editor/levels.h"
	then 
		echo "Error with Level Editor"
	else
		sed -i -e "s/Level Editor exited cleanly//g" "Level Editor/levels.h"
		nouveau=$(grep ^"#define" "Level Editor/levels.h")
		ancien=$(grep "#define LEVEL_Max" breaker.h)
		sed -i -e "s/$ancien/$nouveau/" breaker.h
# Probleme avec les esapces / Problem with spaces
		sed -i -e "s/ / /g" breaker.h
		cp "Level Editor/levels.h" levels.h
		rm "Level Editor/levels.h"
fi
